package com.github.kotvertolet.youtubejextractor.models.newModels;

import com.google.gson.annotations.SerializedName;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;

/**
 * 类功能描述(类上)
 *
 * @author AnBetter
 * @since 2021-04-16
 */
public class MediaCommonConfig implements Sequenceable, Serializable {
    @SerializedName("dynamicReadaheadConfig")
    private DynamicReadaheadConfig dynamicReadaheadConfig;

    public static final Sequenceable.Producer<MediaCommonConfig> CREATOR = new Producer<MediaCommonConfig>() {
        @Override
        public MediaCommonConfig createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            MediaCommonConfig mediaCommonConfig = new MediaCommonConfig();
            mediaCommonConfig.unmarshalling(parcel);
            return mediaCommonConfig;
        }
    };

    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeSequenceable(this.dynamicReadaheadConfig);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        parcel.readSequenceable(this.dynamicReadaheadConfig);
        return true;
    }

    @Override
    public String toString() {
        return "MediaCommonConfig{" +
                "dynamicReadaheadConfig = '" + dynamicReadaheadConfig + '\'' +
                "}";
    }

    public DynamicReadaheadConfig getDynamicReadaheadConfig() {
        return dynamicReadaheadConfig;
    }

    public void setDynamicReadaheadConfig(DynamicReadaheadConfig dynamicReadaheadConfig) {
        this.dynamicReadaheadConfig = dynamicReadaheadConfig;
    }
}
